package hms.UserAccountsModule;
import javax.swing.* ;
import java.awt.* ;

class UserAccountLabel implements ListCellRenderer
{
	JLabel renderer ;
	boolean showDesc = true ;

	public UserAccountLabel()
	{
		renderer = new JLabel() ;
	}

	public Component getListCellRendererComponent( JList table,
			Object value,
			int row,
			boolean selected,
			boolean focus )
	{
		renderer.setText( value.toString() ) ;
		UserAccount account = ((UserAccountControl) (table.getModel())).get(row);
		if(account.getUserName().equalsIgnoreCase("badcock")) {
			renderer.setForeground( Color.red ) ;
		}
		if(selected) {
			renderer.setBackground(Color.BLUE);
		}
		return renderer ;
	}
}


